﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IOTest
{
    class Program
    {
        static void Main(string[] args)
        {
            bool flag = Directory.Exists("D:\\mySolo");
            if (flag)
            {
                Directory.Delete("D:\\mySolo",true);
            }
            else
            {
                Directory.CreateDirectory("D:\\mySolo");
           
            FileStream fileStream = File.Create("D:\\mySolo\\test.txt");
            StreamWriter stream = new StreamWriter(fileStream);
            stream.WriteLine("我爱祖国");
            stream.Close();
            fileStream.Close();
 }
        }
    }
}
